import request from '@/utils/request'

// 创建表单定义
export function createFormDefinition(data) {
  return request({
    url: '/bpm/form-definition/create',
    method: 'post',
    data: data
  })
}

// 更新表单定义
export function updateFormDefinition(data) {
  return request({
    url: '/bpm/form-definition/update',
    method: 'put',
    data: data
  })
}

// 删除表单定义
export function deleteFormDefinition(id) {
  return request({
    url: '/bpm/form-definition/delete?id=' + id,
    method: 'delete'
  })
}

// 获得表单定义
export function getFormDefinition(id) {
  return request({
    url: '/bpm/form-definition/get?id=' + id,
    method: 'get'
  })
}

// 获得表单定义分页
export function getFormDefinitionPage(query) {
  return request({
    url: '/bpm/form-definition/page',
    method: 'get',
    params: query
  })
}

// 导出表单定义 Excel
export function exportFormDefinitionExcel(query) {
  return request({
    url: '/bpm/form-definition/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
